<?php


namespace app\api\validate;



use think\Validate;

class User extends Validate
{

    protected $rule = [
        'phone_code' => 'require',
        'open_id' => 'require',
        'code' => 'require',
        'id' => 'require',
        'user_id' => 'require',
    ];

    protected $message = [
        'open_id.require' => '登录openid不能为空',
        'phone_code.require' => '手机code必传',
        'nickname.require' => '用户昵称不能为空',
        'code.require' => '微信code不能为空',
        'id.require' => '用户id必传',
        'user_id.require' => '推广人id必传',
    ];

    protected $scene = [
        'login' => ['open_id','phone_code'],
        'getOpenId' => ['code'],
        'update' => ['id','headimgurl','nickname'],
        'getUserInfo' => ['id'],
        'customer' => ['user_id'],
    ];
}